import * as types from '@/constants/ActionTypes';
const initialState = {
  user:{
    userId: '',
    account: '',
    password: '',
    nickname: '未设置昵称',
    vip: '',
    avatar: '',
    phone: '',
    typeId: '',
    userCity: '',
    userCityCode: ''
  }
}
export default function user(state = initialState,action){
  console.log('--reduce user--',action)
	switch(action.type){
		case types.UPDATE_USER:
      console.log(' reducer update user')
      console.log(' old-state',state)
      //console.log(' newState',action)
      return Object.assign({}, state, action.user);
		default:
      console.log('----default')
			return state;
	}
}